package com.jie.langlangmall.portal.service.impl;

import com.jie.langlangmall.mapper.OmsOrderReturnApplyMapper;
import com.jie.langlangmall.model.OmsOrderReturnApply;
import com.jie.langlangmall.portal.domain.OmsOrderReturnApplyParam;
import com.jie.langlangmall.portal.service.OmsOrderReturnApplyService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @Author Jie
 * @Date 2024/11/28
 * @Email 3217998214@qq.com
 * @Description 退货申请
 */
@Service
public class OmsOrderReturnApplyServiceImpl implements OmsOrderReturnApplyService {

    @Autowired
    private OmsOrderReturnApplyMapper returnApplyMapper;

    /**
     * 退货申请
     * @param returnApply
     */
    @Override
    public void create(OmsOrderReturnApplyParam returnApply) {
        OmsOrderReturnApply realApply = new OmsOrderReturnApply();
        BeanUtils.copyProperties(returnApply, realApply);
        realApply.setCreateTime(new Date());
        realApply.setStatus(0); // 设置申请状态为待处理
        returnApplyMapper.insert(realApply);
    }
}
